package com.nts.visionworks.business.endpoint.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import com.nts.visionworks.business.application.domain.ApplicationUpdated;
import com.nts.visionworks.business.application.domain.ServiceApplication;
import com.nts.visionworks.business.application.domain.ServiceChannel;
import com.nts.visionworks.business.schedule.domain.ScheduleEndPointPower;
import com.nts.visionworks.business.streamevent.domain.StreamSynapse;
import com.nts.visionworks.core.validation.EntityIdNotNull;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Range;

/**
 * EndPoint generated by hbm2java
 */
@Entity
@Table(name = "end_point", catalog = "visionworks")
public class EndPoint implements java.io.Serializable
{

	private Long endPointId;
	private BuildingFloorArea buildingFloorArea;
	private ServiceApplication serviceApplication;
	private ServiceChannel serviceChannel;
	private Integer class_;
	private String endPointName;
	private short ipType;
	private String ipAddress;
	private String macAddress;
	private short powerStatus;
	private boolean usable;
	private Integer screenshotKeepingPeriod;
	private String remoteAddress;
	private String remoteId;
	private String remotePassword;
	private String specification;
	private String description;
	private Date createdDateTime;
	private long creatorId;
	private Date updatedDateTime;
	private Set<EndPointDisplay> endPointDisplays = new HashSet<EndPointDisplay>(
			0);
	private Set<ScheduleEndPointPower> scheduleEndPointPowers = new HashSet<ScheduleEndPointPower>(
			0);
	private Set<StreamSynapse> streamSynapsesForSourceEndPointId = new HashSet<StreamSynapse>(
			0);
	private Set<StreamSynapse> streamSynapsesForDestinationEndPointId = new HashSet<StreamSynapse>(
			0);
	private Set<ErrorRecord> errorRecords = new HashSet<ErrorRecord>(0);
	private Set<ApplicationUpdated> applicationUpdateds = new HashSet<ApplicationUpdated>(
			0);
	private Set<EndPointScreenshot> endPointScreenshots = new HashSet<EndPointScreenshot>(
			0);
	private Set<EndPointCategory> endPointCategories = new HashSet<EndPointCategory>(
			0);

	public EndPoint()
	{
	}

	public EndPoint(BuildingFloorArea buildingFloorArea,
			ServiceApplication serviceApplication,
			ServiceChannel serviceChannel, String endPointName, short ipType,
			String macAddress, short powerStatus, boolean usable,
			Date createdDateTime, long creatorId)
	{
		this.buildingFloorArea = buildingFloorArea;
		this.serviceApplication = serviceApplication;
		this.serviceChannel = serviceChannel;
		this.endPointName = endPointName;
		this.ipType = ipType;
		this.macAddress = macAddress;
		this.powerStatus = powerStatus;
		this.usable = usable;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
	}

	public EndPoint(BuildingFloorArea buildingFloorArea,
			ServiceApplication serviceApplication,
			ServiceChannel serviceChannel, Integer class_, String endPointName,
			short ipType, String ipAddress, String macAddress,
			short powerStatus, boolean usable, Integer screenshotKeepingPeriod,
			String remoteAddress, String remoteId, String remotePassword,
			String specification, String description, Date createdDateTime,
			long creatorId, Date updatedDateTime,
			Set<EndPointDisplay> endPointDisplays,
			Set<ScheduleEndPointPower> scheduleEndPointPowers,
			Set<StreamSynapse> streamSynapsesForSourceEndPointId,
			Set<StreamSynapse> streamSynapsesForDestinationEndPointId,
			Set<ErrorRecord> errorRecords,
			Set<ApplicationUpdated> applicationUpdateds,
			Set<EndPointScreenshot> endPointScreenshots,
			Set<EndPointCategory> endPointCategories)
	{
		this.buildingFloorArea = buildingFloorArea;
		this.serviceApplication = serviceApplication;
		this.serviceChannel = serviceChannel;
		this.class_ = class_;
		this.endPointName = endPointName;
		this.ipType = ipType;
		this.ipAddress = ipAddress;
		this.macAddress = macAddress;
		this.powerStatus = powerStatus;
		this.usable = usable;
		this.screenshotKeepingPeriod = screenshotKeepingPeriod;
		this.remoteAddress = remoteAddress;
		this.remoteId = remoteId;
		this.remotePassword = remotePassword;
		this.specification = specification;
		this.description = description;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.endPointDisplays = endPointDisplays;
		this.scheduleEndPointPowers = scheduleEndPointPowers;
		this.streamSynapsesForSourceEndPointId = streamSynapsesForSourceEndPointId;
		this.streamSynapsesForDestinationEndPointId = streamSynapsesForDestinationEndPointId;
		this.errorRecords = errorRecords;
		this.applicationUpdateds = applicationUpdateds;
		this.endPointScreenshots = endPointScreenshots;
		this.endPointCategories = endPointCategories;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "EndPointId", unique = true, nullable = false)
	public Long getEndPointId()
	{
		return this.endPointId;
	}

	public void setEndPointId(Long endPointId)
	{
		this.endPointId = endPointId;
	}

	@EntityIdNotNull(message = "validation.endpoint.buildingFloorArea.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AreaId", nullable = false)
	public BuildingFloorArea getBuildingFloorArea()
	{
		return this.buildingFloorArea;
	}

	public void setBuildingFloorArea(BuildingFloorArea buildingFloorArea)
	{
		this.buildingFloorArea = buildingFloorArea;
	}

	@EntityIdNotNull(message = "validation.endpoint.serviceApplication.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ApplicationId", nullable = true)
	public ServiceApplication getServiceApplication()
	{
		return this.serviceApplication;
	}

	public void setServiceApplication(ServiceApplication serviceApplication)
	{
		this.serviceApplication = serviceApplication;
	}

	@EntityIdNotNull(message = "validation.endpoint.serviceChannel.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ChannelId", nullable = true)
	public ServiceChannel getServiceChannel()
	{
		return this.serviceChannel;
	}

	public void setServiceChannel(ServiceChannel serviceChannel)
	{
		this.serviceChannel = serviceChannel;
	}

	@Column(name = "Class")
	public Integer getClass_()
	{
		return this.class_;
	}

	public void setClass_(Integer class_)
	{
		this.class_ = class_;
	}

	@NotNull(message = "validation.endpoint.endPointName.notNull")
	@Range(message = "validation.endpoint.endPointName.length", max = 40, min = 1)
	@Column(name = "EndPointName", nullable = false, length = 40)
	public String getEndPointName()
	{
		return this.endPointName;
	}

	public void setEndPointName(String endPointName)
	{
		this.endPointName = endPointName;
	}

	@Range(message = "validation.endpoint.ipType.range", max = 1, min = 0)
	@Column(name = "IpType", nullable = false)
	public short getIpType()
	{
		return this.ipType;
	}

	public void setIpType(short ipType)
	{
		this.ipType = ipType;
	}

	
	@NotNull(message = "validation.endpoint.ipAddress.notNull")
	@Size(message = "validation.endpoint.ipAddress.length", max = 39, min = 7)
	@Column(name = "IpAddress", nullable = false, length = 39)
	public String getIpAddress()
	{
		return this.ipAddress;
	}

	public void setIpAddress(String ipAddress)
	{
		this.ipAddress = ipAddress;
	}

	@NotNull(message = "validation.endpoint.macAddress.notNull")
	@Size(message = "validation.endpoint.macAddress.length", max = 17, min = 17)
	@Column(name = "MacAddress", nullable = false, length = 17)
	public String getMacAddress()
	{
		return this.macAddress;
	}

	public void setMacAddress(String macAddress)
	{
		this.macAddress = macAddress;
	}

	@Range(message = "validation.endpoint.powerStatus.range", max = 2, min = 0)
	@Column(name = "PowerStatus", nullable = false)
	public short getPowerStatus()
	{
		return this.powerStatus;
	}

	public void setPowerStatus(short powerStatus)
	{
		this.powerStatus = powerStatus;
	}

	@Column(name = "Usable", nullable = false)
	public boolean isUsable()
	{
		return this.usable;
	}

	public void setUsable(boolean usable)
	{
		this.usable = usable;
	}

	@Column(name = "ScreenshotKeepingPeriod")
	public Integer getScreenshotKeepingPeriod()
	{
		return this.screenshotKeepingPeriod;
	}

	public void setScreenshotKeepingPeriod(Integer screenshotKeepingPeriod)
	{
		this.screenshotKeepingPeriod = screenshotKeepingPeriod;
	}

	@Size(message = "validation.endpoint.remoteAddress.length", max = 39, min = 7)
	@Column(name = "RemoteAddress", length = 39)
	public String getRemoteAddress()
	{
		return this.remoteAddress;
	}

	public void setRemoteAddress(String remoteAddress)
	{
		this.remoteAddress = remoteAddress;
	}

	@Range(message = "validation.endpoint.remoteId.length", max = 40, min = 1)
	@Column(name = "RemoteId", length = 40)
	public String getRemoteId()
	{
		return this.remoteId;
	}

	public void setRemoteId(String remoteId)
	{
		this.remoteId = remoteId;
	}

	@Size(message = "validation.endpoint.remotePassword.length", max = 40, min = 1)
	@Column(name = "RemotePassword", length = 40)
	public String getRemotePassword()
	{
		return this.remotePassword;
	}

	public void setRemotePassword(String remotePassword)
	{
		this.remotePassword = remotePassword;
	}

	@Max(message = "validation.endpoint.specification.max", value = 1000)
	@Column(name = "Specification", length = 1000)
	public String getSpecification()
	{
		return this.specification;
	}

	public void setSpecification(String specification)
	{
		this.specification = specification;
	}

	@Max(message = "validation.endpoint.description.max", value = 1000)
	@Column(name = "Description", length = 1000)
	public String getDescription()
	{
		return this.description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId", nullable = false)
	public long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "endPoint")
	public Set<EndPointDisplay> getEndPointDisplays()
	{
		return this.endPointDisplays;
	}

	public void setEndPointDisplays(Set<EndPointDisplay> endPointDisplays)
	{
		this.endPointDisplays = endPointDisplays;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "endPoint")
	public Set<ScheduleEndPointPower> getScheduleEndPointPowers()
	{
		return this.scheduleEndPointPowers;
	}

	public void setScheduleEndPointPowers(
			Set<ScheduleEndPointPower> scheduleEndPointPowers)
	{
		this.scheduleEndPointPowers = scheduleEndPointPowers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "endPointBySourceEndPointId")
	public Set<StreamSynapse> getStreamSynapsesForSourceEndPointId()
	{
		return this.streamSynapsesForSourceEndPointId;
	}

	public void setStreamSynapsesForSourceEndPointId(
			Set<StreamSynapse> streamSynapsesForSourceEndPointId)
	{
		this.streamSynapsesForSourceEndPointId = streamSynapsesForSourceEndPointId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "endPointByDestinationEndPointId")
	public Set<StreamSynapse> getStreamSynapsesForDestinationEndPointId()
	{
		return this.streamSynapsesForDestinationEndPointId;
	}

	public void setStreamSynapsesForDestinationEndPointId(
			Set<StreamSynapse> streamSynapsesForDestinationEndPointId)
	{
		this.streamSynapsesForDestinationEndPointId = streamSynapsesForDestinationEndPointId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "endPoint")
	public Set<ErrorRecord> getErrorRecords()
	{
		return this.errorRecords;
	}

	public void setErrorRecords(Set<ErrorRecord> errorRecords)
	{
		this.errorRecords = errorRecords;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "endPoint")
	public Set<ApplicationUpdated> getApplicationUpdateds()
	{
		return this.applicationUpdateds;
	}

	public void setApplicationUpdateds(
			Set<ApplicationUpdated> applicationUpdateds)
	{
		this.applicationUpdateds = applicationUpdateds;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "endPoint")
	public Set<EndPointScreenshot> getEndPointScreenshots()
	{
		return this.endPointScreenshots;
	}

	public void setEndPointScreenshots(
			Set<EndPointScreenshot> endPointScreenshots)
	{
		this.endPointScreenshots = endPointScreenshots;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "end_point_categories", catalog = "visionworks", joinColumns =
	{ @JoinColumn(name = "EndPointId", nullable = false, updatable = false) }, inverseJoinColumns =
	{ @JoinColumn(name = "CategoryId", nullable = false, updatable = false) })
	public Set<EndPointCategory> getEndPointCategories()
	{
		return this.endPointCategories;
	}

	public void setEndPointCategories(Set<EndPointCategory> endPointCategories)
	{
		this.endPointCategories = endPointCategories;
	}

}
